package com.module.assignment
{
	import com.connect.agreement.mclgc.Packet;
	
	import flash.utils.Dictionary;
	
	import helpers.normal.AssignmentLabel;

	public class AssignmentManager
	{
		public static const AllMyAssigns:int = 1;
		
		public static var instance:AssignmentManager = new AssignmentManager();
		
		public var allMyAssigns:Dictionary = new Dictionary();
		
		public var allLabels:Dictionary = new Dictionary();
		
		public var assignToLabels:Dictionary = new Dictionary();
		
		public function AssignmentManager()
		{
		}
		
		public function regLabelToTask(id:int,label:AssignmentLabel):void
		{
			if(hasLabel(label)){
				var oldid:int = allLabels[label];
				if(id != oldid){
					allLabels[label] = id;
				}
			}
			else
			{
				var arr:Array = assignToLabels[id];
				if(!arr)
				{
					arr = [];
					assignToLabels[id] = arr;
				}
				arr.push(label);
				allLabels[label] = id;
			}
		}
		
		public function hasLabel(label:AssignmentLabel):Boolean
		{
			return allLabels[label];
		}
		
		public function update(p:Packet):void
		{
			if(!p)
				return;
			switch(p.cmd)
			{
				case 
			}
		}
	}
}